#include<stdio.h>

struct person
{
	char name[16];
	int age;
	char sex;
	char phone[12];
};

typedef struct person p;

typedef union un
{
	int num;
	char ch;
	p student;
	p teacher;
}a,*a_p;

int main(){
	//1.定义完共用体变量再赋值
	a u;
	a_p p;
	p = &u;
	u.num = 67;
	printf("num = %d, ch = %c\n",p->num, p->ch);//num = 67, ch = C
}
